package com.songcha.library_database.helper

import android.content.Context
import org.greenrobot.greendao.database.Database

/*
class MyDaoOpenHelper(context: Context,name:String):DaoMaster.OpenHelper(context,name) {
    //database upgrade
    override fun onUpgrade(db: Database?, oldVersion: Int, newVersion: Int) {
        super.onUpgrade(db, oldVersion, newVersion)

        if(db==null) return

        var tmpOldVersion = oldVersion
        if(tmpOldVersion == 1 && newVersion > tmpOldVersion){
            dbUpgrade_1_2(db)
            tmpOldVersion = 2
        }
        if(tmpOldVersion == 2 && newVersion > tmpOldVersion){
            dbUpgrade_2_3(db)
            tmpOldVersion = 3
        }
        if(tmpOldVersion == 3 && newVersion > tmpOldVersion){
            dbUpgrade_3_4(db)
            tmpOldVersion = 4
        }
        if(tmpOldVersion == 4 && newVersion > tmpOldVersion){
            dbUpgrade_4_5(db)
            tmpOldVersion = 5
        }

        if(tmpOldVersion == 5 && newVersion > tmpOldVersion){
            dbUpgrade_5_6(db)
            tmpOldVersion = 6
        }

        if(tmpOldVersion == 6 && newVersion > tmpOldVersion){
            dbUpgrade_6_7(db)
            tmpOldVersion = 7
        }

        if(tmpOldVersion == 7 && newVersion > tmpOldVersion){
            dbUpgrade_7_8(db)
            tmpOldVersion = 8
        }


    }

    //1 to 2
    private fun dbUpgrade_1_2(db: Database){

    }

    private fun dbUpgrade_2_3(db: Database){

    }

    private fun dbUpgrade_3_4(db: Database){

    }

    private fun dbUpgrade_4_5(db: Database){

    }

    private fun dbUpgrade_5_6(db: Database){

    }

    private fun dbUpgrade_6_7(db: Database){

    }

    private fun dbUpgrade_7_8(db: Database){

    }
}*/
